import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class RefTest {
    public static void main(String[] args) throws NoSuchFieldException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        Class c = Student.class;
        Method m = c.getDeclaredMethod("show");
        Field f = c.getDeclaredField("name");
        Constructor con = c.getDeclaredConstructor();
        Student s = (Student) c.newInstance();
        f.set(s,"sf");
        Field ff = c.getDeclaredField("list");
        List list = new ArrayList();
        list.add(s);
        ff.set(s,list);
        m.invoke(s);
        System.out.println(con.getAnnotatedReceiverType());
        System.out.println(s.name);
    }
}
